Skip to content

Support mkl_fft in virtual environment out of the box #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 24, 2025
Merged

Conversation

ekomarova
Copy link
Collaborator

Since location of "Library\bin" in the virtual environment is not on the default search path, importing of mkl_fft and numpy fails.

This change introduces "_init_helper.py" file which implements the following logic using built-in os Python module:

  1. If os.add_dll_directory attribute exists, and VIRTUAL_ENV environment variable is set, and os.path.join(os.environ["VIRTUAL_ENV"], "Library", "bin") folder exists, call os.add_dll_directory with that directory

@ekomarova ekomarova self-assigned this Mar 24, 2025
@ekomarova ekomarova linked an issue Mar 24, 2025 that may be closed by this pull request
@ekomarova ekomarova changed the title Support mkl_fft in vritual environment out of the box Support mkl_fft in virtual environment out of the box Mar 24, 2025
Copy link
Collaborator

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @ekomarova, LGTM!

@ekomarova ekomarova merged commit 467e496 into master Mar 24, 2025
40 checks passed
@ekomarova ekomarova deleted the fix_import branch March 24, 2025 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't import numpy installed as dependency
2 participants